gh-101561: Add typing.override decorator#101564
Merged
JelleZijlstra merged 10 commits intopython:mainfrom Feb 27, 2023
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code is pulled almost unchanged from
typing_extensions:Question that came up was where to put the type variable and what to name it:
typing_extensionsthe type variables use underscore prefixes to indicate that they are not public, buttypingdoesn't appear to use that convention so I named the type variableF.Callablewhich is defined below. If this is a problem I could correct it using a forward reference, or we could try to rearrange the module to put special forms above type variables.Testing the code:
First set up the repo, following instructions
at https://devguide.python.org/ by running:
Then run the typing tests:
I ran the full test suite with
and it came back clean except for a
test_grpfailure which I seem to get on trunk as well - likely something in my build is misconfigured but I'm pretty sure it is unrelated to the changes here.Make sure the docs build: